import 'package:bxultimate/app/theme/app_theme.dart';
import 'package:bxultimate/widgets/mk_page.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';

import 'controller.dart';

class OrganizationStatisticsTaskDetailPage extends StatefulWidget {
  const OrganizationStatisticsTaskDetailPage({Key? key}) : super(key: key);

  @override
  State<OrganizationStatisticsTaskDetailPage> createState() => _OrganizationStatisticsTaskDetailPageState();
}

class _OrganizationStatisticsTaskDetailPageState extends State<OrganizationStatisticsTaskDetailPage> {
  final controller = Get.find<OrganizationStatisticsTaskDetailController>();
  final state = Get.find<OrganizationStatisticsTaskDetailController>().state;

  @override
  Widget build(BuildContext context) {
    return MkPage(child: Obx(()=>Scaffold(
        backgroundColor: Colors.transparent,
        appBar: TDNavBar(
          backgroundColor: Colors.transparent,
          title: '${state.taskInfo.taskFillUserName}提交的详情',
        ),
        body: SingleChildScrollView(
          padding: EdgeInsets.only(left: AppTheme.iDefaultPadding, right: AppTheme.iDefaultPadding),
          child: Column(
            children: [
              ...state.formItem.map((e) => TDCell(
                title: '${e.textInput}',
                note: '${e.value}',
              ))
            ],
          ),
        )
    )));
  }

  @override
  void dispose() {
    Get.delete<OrganizationStatisticsTaskDetailController>();
    super.dispose();
  }
}